﻿<%@ Page Title="" Language="C#" MasterPageFile="~/iFrameMasterPage.master" AutoEventWireup="true" CodeFile="iFrameAdmin_Discounts.aspx.cs" Inherits="iFrameAdmin_Discounts" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
<script language ="javascript" type ="text/javascript" >

    function Redirect(DiscountID) {

        document.location = "iFrameAdmin_EditDiscount.aspx?DiscountID=" + DiscountID;
    }
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<asp:UpdatePanel ID ="UpdatePanel2"  runat ="server"  >
<ContentTemplate >
<table style="width: 100%;" cellpadding ="0" cellspacing ="2">
    <tr>
        <td style ="width :235px">
            <asp:TextBox ID="txtSearch"  Text =<%# Where.ListLoadStatment.Lexeme %> runat="server"  CssClass="TextBox"></asp:TextBox>
        </td>
        <td style ="width:8px">
            &nbsp
        </td>
        <td>
            
            <asp:ImageButton ID=btnFind runat="server"  
                ImageUrl="~/images/search_button.gif" 
                OnClick ="Find_Click"
                ToolTip="Поиск"/>
        </td>
        
        <td style ="text-align :right ">        
        <asp:Button ID=btnnew runat="server" Text="Добавить" CssClass ="btn"  OnClick ="AddButton_Click"  />
            
        </td>
    </tr>
    
</table>
</ContentTemplate> 
</asp:UpdatePanel> 
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" Runat="Server">
<asp:UpdatePanel ID ="UpdatePanel1"  runat ="server"  >
<ContentTemplate >
 
 <table cellpadding="0" cellspacing="0" width="100%">
        <tr id="Tr_GridHead" runat="server" style="height:25px">
            <td class="grd_td_head" style="width :20px">
                 <asp:UpdateProgress ID="UpdateProgress2" runat="server"  >
                    <ProgressTemplate >
                        <asp:Image ID=Image11 ImageUrl="~/images/loadinfo.net.gif" runat="server" />
                    </ProgressTemplate>
                    </asp:UpdateProgress>
                    &nbsp
            </td>
            <td class="grd_td_head" style="width:300px">
                <asp:LinkButton ID="GID" runat="server" CommandArgument="Name" 
                    OnClick="lvSort">Наименование</asp:LinkButton>
                <asp:Label ID="Label1" runat="server" CssClass='<%# GetHeadCss("Name") %>' 
                    Text="&nbsp;&nbsp;&nbsp;"></asp:Label>
            </td>
            <td class="grd_td_head">
                <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument="Describe" 
                    OnClick="lvSort">Описание</asp:LinkButton>
                <asp:Label ID="Label2" runat="server" 
                    CssClass='<%# GetHeadCss("Describe") %>' Text="&nbsp;&nbsp;&nbsp;"></asp:Label>
            </td>            
            <td class="grd_td_head" style="width:130px; ">
                <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument="dtStart" 
                    OnClick="lvSort">Начало</asp:LinkButton>
                <asp:Label ID="Label3" runat="server" 
                    CssClass='<%# GetHeadCss("dtStart")%>' Text="&nbsp;&nbsp;&nbsp;"></asp:Label>
            </td>            
            <td class="grd_td_head" style="width:130px;">
                <asp:LinkButton ID="LinkButton3" runat="server" CommandArgument="dtFinish" 
                    OnClick="lvSort">Окончание</asp:LinkButton>
                <asp:Label ID="Label4" runat="server" 
                    CssClass='<%# GetHeadCss("dtFinish") %>' Text="&nbsp;&nbsp;&nbsp;"></asp:Label>
            </td>            
            <td class="grd_td_head" style="width:70px">
                <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument="Percent" 
                    OnClick="lvSort">Проц.</asp:LinkButton>
                <asp:Label ID="Label5" runat="server" 
                    CssClass='<%# GetHeadCss("Percent") %>' Text="&nbsp;&nbsp;&nbsp;"></asp:Label>
            </td>            
            <td class="grd_td_head" style="width :15px">
                &nbsp;
            </td>         
        </tr>
    </table> 
   
 <table width="100%" cellpadding ="0" cellspacing ="0">     
    <asp:ListView ID="lvDiscounts" runat="server" 
            onpagepropertieschanged="lvSurfaceGroups_PagePropertiesChanged" >
    <LayoutTemplate  >  
    </tr><tr runat="server" id="itemPlaceholder" ></tr>              
    </LayoutTemplate>
  
    <ItemTemplate >
    <tr >
    <td class ="grd_td_item" onclick =<%# GetEditCommand((string)Eval("ID"))  %>  onmouseover ="GrdItemOnMouseOver(this);" onmouseout ="GrdItemOnMouseOut(this);">
    <div style = "width:100%;"  >
     <table width="100%" cellpadding ="0" cellspacing ="0">     
        <tr id=Tr1  runat="server" style="height:25px">
            <td  style="width :20px;text-align :center ">
                <asp:Image ID=Image1 runat="server"  ImageUrl ="~/images/grippy.png"/>
            </td>
            
            <td style="width:300px">
                <asp:LinkButton ID=LinkButton2 runat="server" OnClick ="EditDiscount"  CommandArgument =<%#Eval("ID") %> > <%# (string)Eval("Name")%></asp:LinkButton>                                
                
            </td>
            <td >                
                <%# (((string)Eval("Description")).Length == 0 ? "&nbsp" : (string)Eval("Description"))%>                
            </td>         
            
            <td style="width:130px">
                <%# ((DateTime)Eval("dtStart")).ToShortDateString() %>
            </td>            
            <td style="width:130px">
                <%# ((DateTime)Eval("dtFinish")).ToShortDateString()%>
            </td>            
            <td style="width:70px">
                <%# Eval("Percent").ToString ()%>
            </td>            
               
            <td style="width :15px">
                 <asp:ImageButton ID=btnGroupRemove OnClientClick ="OnDeleteClick();" 
                                    ImageUrl ="~/images/trash.png" CommandArgument =<%# (string) Eval("ID") %> 
                                    OnClick ="OnDeleteClick" runat="server" />
            </td>           
        </tr>
        </table> 
        </div>
        </td>
    </tr>        
    </ItemTemplate>        
    </asp:ListView>
    </table>

 <asp:DataPager runat="server" ID="wew"  EnableViewState ="true"  PagedControlID = "lvDiscounts" PageSize=<%# GlobalConstants.Def_RecordOnScreen %> >
        <Fields>
          <asp:NumericPagerField  ButtonType ="Link"                       
              ButtonCount="5"
               PreviousPageText="<--"
               NextPageText="-->" />
               
               <asp:NextPreviousPagerField ButtonType="Link"
                ShowFirstPageButton="true"
                ShowPreviousPageButton="true"
                ShowLastPageButton="true" 
                ShowNextPageButton ="true"/>
        </Fields>
    </asp:DataPager>

</ContentTemplate> 
</asp:UpdatePanel> 
    
    
    
</asp:Content>

